package com.gears_software.sxdc.dccx.data.finder;

import com.gears_software.sxdc.dccx.data.finder.util.GearsAuthInterceptor;
import com.gears_software.sxdc.dccx.data.model.AddZPOrderModel;
import com.gears_software.sxdc.dccx.data.model.ChargeScheduleModel;
import com.gears_software.sxdc.dccx.data.model.DriverPositionModel;
import com.gears_software.sxdc.dccx.data.model.EstimateModel;
import com.gears_software.sxdc.dccx.data.model.LatLonListModel;
import com.gears_software.sxdc.dccx.data.model.MyTripZCDetailModel;
import com.gears_software.sxdc.dccx.data.model.MyTripZCModel;
import com.gears_software.sxdc.dccx.data.model.ResultModel;
import com.gears_software.sxdc.dccx.data.model.ValuationRuleModel;
import com.gears_software.sxdc.dccx.data.model.YunTuApiModel;
import com.gears_software.sxdc.dccx.data.model.ZPOrderModel;
import com.gears_software.sxdc.dccx.data.model.request.RCancelZPOrderModel;
import com.gears_software.sxdc.dccx.data.model.request.RComplainModel;
import com.gears_software.sxdc.dccx.data.model.request.RDeleteZporderModel;
import com.gears_software.sxdc.dccx.data.model.request.RZCOrderRatedModel;
import com.gears_software.sxdc.dccx.data.model.request.RZPOrderModel;

import org.androidannotations.rest.spring.annotations.Body;
import org.androidannotations.rest.spring.annotations.Get;
import org.androidannotations.rest.spring.annotations.Path;
import org.androidannotations.rest.spring.annotations.Post;
import org.androidannotations.rest.spring.annotations.Put;
import org.androidannotations.rest.spring.annotations.Rest;
import org.androidannotations.rest.spring.api.RestClientErrorHandling;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.util.List;

/**
 * Created by chezhenzhen on 2017/9/7.
 */
@Rest(rootUrl = RequestUrl.ROOT, converters = {MappingJackson2HttpMessageConverter.class}, interceptors = GearsAuthInterceptor.class)
public interface IZPOrderFinder extends RestClientErrorHandling {

    //专车-我的行程接口
    @Get("/api/zporder/driver_orders?type={type}")
    ResultModel<List<MyTripZCModel>> getZCTripList(@Path String type);

    //专车-我的行程详情页接口
    @Get("/api/zporder/zc_orderdetail?type={type}&id={id}")
    ResultModel<MyTripZCDetailModel> getZCTripDetail(@Path String type, @Path String id);

    //专车-我的行程订单评价
    @Post("/api/rate/zcorder_rated")
    ResultModel<String> goZCOrderRate(@Body RZCOrderRatedModel rzcOrderRatedModel);

    //专车-我的行程订单投诉
    @Post("/api/rate/zcorder_complaint")
    ResultModel<String> goZCComplaint(@Body RComplainModel zccomplainModel);

    //专车-我要用车预估计算价格
    @Get("/api/zporder/estimate?zTime={zTime}&zMile={zMile}&carType={carType}&address={address}")
    ResultModel<EstimateModel> getEstimate(@Path String zTime, @Path String zMile, @Path String carType, @Path int address);

    //专车我的行程费用详情接口(乘客端)
    @Get("/api/zporder/zcorder_feedetail?id={id}")
    ResultModel<ChargeScheduleModel> getChargeSchedule(@Path String id);

    //专车-我要用车新增专车订单
    @Post("/api/zporder/add")
    ResultModel<AddZPOrderModel> addZCOrder(@Body RZPOrderModel zpOrderModel);

    //查询运价规则信息
    @Get("/api/zporder/get_fare?faretype={faretype}")
    ResultModel<ValuationRuleModel> getFare(@Path String faretype);

    //专车-取消订单
    @Put("/api/zporder/cancel_zcorder")
    ResultModel<String> cancelZPOrder(@Body RCancelZPOrderModel cancelZPOrder);

    //云图检索周边车辆
    @Get("http://yuntuapi.amap.com/nearby/around?key={key}&center={center}&radius={radius}&searchtype={searchtype}&timerange={timerange}")
    YunTuApiModel getYunTuApi(@Path String key, @Path String center, @Path String radius, @Path String searchtype, @Path String timerange);

    @Get("/api/zporder/get_lonlatlist?orderid={orderid}&lat={lat}&lon={lon}")
    ResultModel<LatLonListModel> getLonLatList(@Path String orderid, @Path String lat, @Path String lon);

    //显示乘客正在进行的订单
    @Get("/api/zporder/get_ingpassengerorder")
    ResultModel<ZPOrderModel> getIngOrder();

    //我的行程订单删除
    @Post("/api/zporder/passenger_deletezporder")
    ResultModel<String> deleteZporder(@Body RDeleteZporderModel deleteZporderModel);

    //读取司机实时位置
    @Get("/api/zporder/get_driverposition?orderid={orderid}")
    ResultModel<DriverPositionModel> getDriverPosition(@Path String orderid);


}
